<%--
  Created by IntelliJ IDEA.
  User: DELL
  Date: 2020/6/20
  Time: 15:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>注册</title>
    <script>
        function fn() {
            var  p1= document.getElementsByName("password")[0].value;
            var  p2= document.getElementsByName("password1")[0].value;
            if (p1==p2) {
               return true;
            }else {
                var spanEle=document.getElementById("msg");
                spanEle.innerText="密码不一致，请重新输入"
                return false;
            }
        }
    </script>
</head>
<body>
<form action="${pageContext.request.contextPath}/reg" method="post" onsubmit="return fn()">
    账户：<input type="text" name="username"/><br>
    密码：<input type="text" name="password"/><br>
    确认密码：<input type="text" name="password1"/><br>
    <button type="submit">注册</button><br>
    <span id="msg"></span>
</form>
</body>
</html>
